<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增域名管理')"/>
    <th:block th:include="include :: select2-css"/>

</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-webmain-add">
        <div class="form-group">
            <label class="col-sm-3 control-label">链接地址：</label>
            <div class="col-sm-8">
                <input name="mainUrl" class="form-control" type="text">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-4 control-label">链接状态：</label>
            <div class="col-sm-8">
                <label class="toggle-switch switch-solid">
                    <input checked id="mainStatus" name="mainStatus" type="checkbox">
                    <span></span>
                </label>
            </div>
        </div>

    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<script type="text/javascript">
    var prefix = ctx + "system/webmain";
    $("#form-webmain-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            var data = $('#form-webmain-add').serialize();
            var mainStatus = $("input[id='mainStatus']").is(':checked') === true ? 0 : 1;
            console.log(data);
            $.operate.save(prefix + "/add",data);
        }
    }
</script>
</body>
</html>